1. Field of the Invention
This invention relates generally to the field of computer graphics and, more particularly, to a high performance graphics system which implements super-sampling.
2. Description of the Related Art
A computer system typically relies upon its graphics system for producing visual output on the computer screen or display device. Early graphics systems were only responsible for taking what the processor produced as output and displaying that output on the screen. In essence, they acted as simple translators or interfaces. Modem graphics systems, however, incorporate graphics processors with a great deal of processing power. They now act more like coprocessors rather than simple translators. This change is due to the recent increase in both the complexity and amount of data being sent to the display device. For example, modem computer displays have many more pixels, greater color depth, and are able to display images that are more complex with higher refresh rates than earlier models. Similarly, the images displayed are now more complex and may involve advanced techniques such as anti-aliasing and texture mapping.
As a result, without considerable processing power in the graphics system, the CPU would spend a great deal of time performing graphics calculations. This could rob the computer system of the processing power needed for performing other tasks associated with program execution and thereby dramatically reduce overall system performance. With a powerful graphics system, however, when the CPU is instructed to draw a box on the screen, the CPU is freed from having to compute the position and color of each pixel. Instead, the CPU may send a request to the video card stating: xe2x80x9cdraw a box at these coordinatesxe2x80x9d. The graphics system then draws the box, freeing the processor to perform other tasks.
Generally, a graphics system in a computer (also referred to as a graphics system) is a type of video adapter that contains its own processor to boost performance levels. These processors are specialized for computing graphical transformations, so they tend to achieve better results than the general-purpose CPU used by the computer system. In addition, they free up the computer""s CPU to execute other commands while the graphics system is handling graphics computations. The popularity of graphical applications, and especially multimedia applications, has made high performance graphics systems a common feature of computer systems. Most computer manufacturers now bundle a high performance graphics system with their systems.
Since graphics systems typically perform only a limited set of functions, they may be customized and therefore far more efficient at graphics operations than the computer""s general-purpose central processor. While early graphics systems were limited to performing two-dimensional (2D) graphics, their functionality has increased to support three-dimensional (3D) wire-frame graphics, 3D solids, and now includes support for three-dimensional (3D) graphics with textures and special effects such as advanced shading, fogging, alpha-blending, and specular highlighting.
While the number of pixels is an important factor in determining graphics system performance, another factor of equal import is the quality of the image. Various methods are used to improve the quality of images, including anti-aliasing, alpha blending, and fogging, among numerous others. While various techniques may be used to improve the appearance of computer graphics images, they also have certain limitations. In particular, they may introduce their own aberrations and are typically limited by the density of pixels displayed on the display device.
As a result, a graphics system is desired which is capable of utilizing increased performance levels to increase not only the number of pixels rendered but also the quality of the image rendered. In addition, a graphics system is desired which is capable of utilizing increases in processing power to improve graphics effects.
Prior art graphics systems have generally fallen short of these goals. Prior art graphics systems use a conventional frame buffer for refreshing pixel/video data on the display. The frame buffer stores rows and columns of pixels that exactly correspond to respective row and column locations on the display. Prior art graphics system render 2D and/or 3D images or objects into the frame buffer in pixel form, and then read the pixels from the frame buffer during a screen refresh to refresh the display. Thus, the frame buffer stores the output pixels that are provided to the display. To reduce visual artifacts that may be created by refreshing the screen at the same time as the frame buffer is being updated, most graphics systems"" frame buffers are double-buffered.
To obtain images that are more realistic, some prior art graphics systems have gone further by generating more than one sample per pixel. In other words, some graphics systems implement super-sampling whereby the graphics system may generate a larger number of samples than exist display elements or pixels on the display. By calculating more samples than pixels (i.e., super-sampling), a more detailed image is calculated than can be displayed on the display device. For example, a graphics system may calculate 4, 8 or 16 samples for each pixel to be output to the display device. After the samples are calculated, they are then combined or filtered to form the pixels that are stored in the frame buffer and then conveyed to the display device. Using pixels formed in this manner may create a more realistic final image because overly abrupt changes in the image may be smoothed by the filtering process.
As used herein, the term xe2x80x9csamplexe2x80x9d refers to calculated information that indicates the color of the sample and possibly other information, such as depth (z), transparency, etc., of a particular point on an object or image. For example, a sample may comprise the following component values: a red value, a green value, a blue value, a z value, and an alpha value (e.g., representing the transparency of the sample). A sample may also comprise other information, e.g., a z-depth value, a blur value, an intensity value, brighter-than-bright information, and an indicator that the sample consists partially or completely of control information rather than color information (i.e., xe2x80x9csample control informationxe2x80x9d).
When a graphics system implements super-sampling, the graphics system typically includes a sample buffer, which may be part of the frame buffer, that stores the samples. As noted above, the sample buffer stores a plurality of samples for each of the pixels to be rendered on the display. In some instances, the rendering engine of the graphic system may desire to write non super-sampled images into the sample buffer (or frame buffer). However, in a system which implements super sampling, the sample buffer can only be configured to hold samples. In this case, the sample buffer cannot accept pixels. Therefore, an improved method is desired for writing pixels into a sample buffer (or frame buffer which stores samples) as samples. In addition, in some instances the user or software may request that a pixel be read from the super-sampled sample buffer or frame buffer. Therefore, it would be desirable to enable a sample buffer or frame buffer which stores a plurality of samples to be able to provide a pixel in response to a request for a pixel.
One embodiment of the invention comprises a graphics system and method for storing pixel values into a sample buffer, wherein the sample buffer is configured to store a plurality of samples for each of a plurality of pixels. An embodiment of the invention is also directed to a graphics system and method for reading pixel values from the sample buffer.
In one embodiment, the graphics system comprises a sample buffer, a memory, e.g., a programmable register, and a graphics processor. The sample buffer is configured to store a plurality of samples for each of a plurality of pixels. The programmable register stores a value indicating a method for pixel to sample conversion, and is preferably software programmable (e.g., user programmable). The graphics processor is coupled to the sample buffer and the programmable register, wherein the graphics processor is operable to write a plurality of pixel values into the sample buffer. The graphics processor is operable to access the memory to determine a method for pixel to sample conversion and store the pixel values in the sample buffer according to the determined method for pixel to sample conversion.
In one embodiment, the graphics system may issue a write command to write a plurality of pixel values into the sample buffer. In performing the write, the graphics system may determine a method for pixel to sample conversion. Determination of the method for pixel to sample conversion may comprise accessing a value from the programmable register, wherein the register value indicates the method for pixel to sample conversion. Thus, the method for pixel to sample conversion may be software and/or user programmable. The register value may indicate the appropriate method for pixel to sample conversion. Alternatively, the register value may indicate the appropriate method for sample to pixel conversion, from which the method for pixel to sample conversion may be derived. The method for pixel to sample conversion indicates or specifies the method used for storing the pixel values into the sample buffer. In one embodiment, the graphics system may then store the pixel values in the sample buffer according to the determined method for pixel to sample conversion.
In one embodiment, the method for pixel to sample conversion may be one of various methods. A first method for pixel to sample conversion may specify a pixel write to all of the pixel""s supporting samples. In this first method, for each respective pixel, the write comprises storing the respective pixel value of the respective pixel in each of the supporting samples of the respective pixel. A second method for pixel to sample conversion may specify a pixel write to a selected one of the pixel""s supporting samples. The second method may also specify the selected one of the pixel""s supporting samples. For example, if 8 samples are used to support each pixel, the method may indicate which of the 8 samples to store the pixel value. In this second method, for each respective pixel, the write comprises storing the respective pixel value of the respective pixel in only the selected one of the respective pixel""s supporting samples.
The graphics system may also issue a read command to read a plurality of pixel values from the sample buffer. In performing the read, the graphics system may determine the method for pixel to sample conversion, i.e., may determine the manner in which the pixels were stored in the sample buffer. The method for sample to pixel conversion to perform the read may be indirectly specified by the method for pixel to sample conversion. The graphics system may then read the pixel values from the sample buffer according to the determined method for pixel to sample conversion.
Where the method for pixel to sample conversion indicates a pixel write to all of the pixel""s supporting samples for storing the pixel values into the sample buffer, then, for each respective pixel, the read may comprise reading at least one respective sample value from the supporting samples of the respective pixel. The respective sample value is the pixel value of the respective pixel. Where the method for pixel to sample conversion indicates a pixel write to a selected one of the pixel""s supporting samples, then, for each respective pixel, the read may comprise reading the selected one of the pixel""s supporting samples to obtain the pixel value of the respective pixel.
As noted above, the memory or programmable register stores a value indicating a method for pixel to sample conversion, and is preferably software programmable (e.g., user programmable). The user can thus program the value of the programmable register via software to choose the method for pixel to sample conversion (and hence the method for sample to pixel conversion).